package com.zhengjiang.nacos.config.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("config")
@RefreshScope //可以使当前类下的配置支持动态更新
public class HelloController {

    @Value("${nacos.config}")
    private String config;

    @RequestMapping("/get")
    public String getConfig(){
        return config;
    }
}
